# apps/bilibili/strategies.py
from utils.base_strategies import DeleteStrategy
from .models import BilibiliVideo, BilibiliVideoComment

class BilibiliDeleteStrategy(DeleteStrategy):
    def delete_content(self, task_id):
        BilibiliVideo.objects.filter(task_id=task_id).delete()

    def delete_comments(self, task_id):
        content_ids = BilibiliVideo.objects.filter(task_id=task_id).values_list('video_id', flat=True)
        BilibiliVideoComment.objects.filter(video_id__in=content_ids).delete()